/*
 * @Description: 创建对象原型模式
 * @Author: rendc
 * @Date: 2021-09-03 10:21:24
 * @LastEditors: rendc
 * @LastEditTime: 2021-09-03 15:32:04
 */
function Person () { };
Person.prototype.name = "zhangsan";
Person.prototype.age = 12;
Person.prototype.gender = "男";
Person.prototype.likes = ['吃饭', '读书', '打豆豆'];
Person.prototype.sayName = function () {
  console.log(this.name);
}

var p1 = new Person();
p1.name = "lisi";
p1.likes.push('打🏀');
var p2 = new Person();
p2.name = "wangwu";
p1.sayName();
console.log(p1.likes);
p2.sayName();
console.log(p2.likes);








